package com.tvunetworks.center.user.mapper;

import com.tvunetworks.center.user.model.GridEvent;
import com.tvunetworks.center.user.model.param.api.GetGridEventParam;
import com.tvunetworks.center.user.model.vo.GridEventVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
/**
 * @program:
 * @description:
 * @author HenryChen
 * @create: 5/23/2019 1:54 PM
 **/
public interface GridEventMapper extends Mapper<GridEvent> {
    /**
     *
     * @param statusList statusList
     * @param now now
     * @return List
     */
    List<GridEvent> listNeedPairEvent(@Param("statusList") List<Integer> statusList, @Param("now") long now);

    /**
     *
     * @param status status
     * @param now now
     * @return List
     */
    List<GridEvent> listNeedStartEvent(@Param("status") int status, @Param("now") long now);

    /**
     *
     * @param status status
     * @param now now
     * @return List
     */
    List<GridEvent> listNeedEndEvent(@Param("status") int status, @Param("now") long now);

    /**
     *
     * @param taskId taskId
     * @return GridEventVo
     */
    GridEventVo getEventVoByTaskId(@Param("taskId") String taskId);

    /**
     *
     * @param pairId pairId
     * @param statusList statusList
     * @return int
     */
    int countActiveEventByPairId(@Param("pairId") int pairId, @Param("statusList") List<Integer> statusList);

    /**
     *
     * @param param param
     * @return List
     */
    List<GridEventVo> listEventVo(GetGridEventParam param);
}
